package org.liveboardgames.agricola.control.delegates.action.prerequisite
{
    import org.liveboardgames.agricola.control.delegates.helper.GameHelper;
    import org.liveboardgames.agricola.model.enums.HouseTypeEnum;
    import org.liveboardgames.agricola.vo.player.Player;
    
    public class RenovationPrerequisiteChecker extends PrerequisiteChecker
    {
        private var material:String;
        
        public function RenovationPrerequisiteChecker(player:Player, material:String)
        {
            super(player);
            this.material = material;
        }
        
        override public function check():Boolean
        {
            // Get the material in which the player's house is built
            var houseMaterial:String = GameHelper.getHouseMaterial(player.farm);
            
            // The user can only renovate from one material to the next
            var canRenovateToMaterial:Boolean = GameHelper.canRenovateToMaterial(player.farm, material);
            
            // Cost is checked in the ActionCheck itself
            
            return canRenovateToMaterial;
        }
    
    }
}